import Vue from 'vue'
import axios from 'axios'
// import VueAxios from 'vue-axios'
import Loading from 'vue-loading-overlay'
// import VueAwesomeSwiper from 'vue-awesome-swiper';
import swiper, { Navigation, Pagination, Autoplay } from 'swiper'
// import AOS from 'aos'

import App from './App.vue'
import router from './router'
// import store from './store'
import 'bootstrap'
import 'vue-loading-overlay/dist/vue-loading.css'
import bus from './bus'
// import currencyFilter from './filters/currency'
// import dateFilter from './filters/date'
//import 'aos/dist/aos.css' // You can also use <link> for styles

// Vue.config.productionTip = false
// Vue.use(VueAxios, axios)
// axios.defaults.withCredentials = true

axios.defaults.baseURL = 'http://localhost:8090/'
Vue.use(router)
Vue.prototype.$http = axios
Vue.prototype.$bus = bus
Vue.component('Loading', Loading)

new Vue({
  router,
  render: (h) => h(App)
}).$mount('#app')

//Vue.use(VueAwesomeSwiper);
swiper.use([Navigation, Pagination, Autoplay])

// router.beforeEach((to, from, next) => {
//   if (to.meta.requiresAuth) {
//     const url = `${process.env.VUE_APP_APIPATH}/api/user/check`
//     axios.post(url).then((response) => {
//       if (response.data.success) {
//         next()
//       } else {
//         next({ name: 'Login' })
//       }
//     })
//   } else {
//     next()
//   }
// })
